package com.crack;import com.eg.Lazy;import java.lang.reflect.Constructor;import java.lang.reflect.InvocationTargetException;/** * @email 99723251@qq.com * @author: zhangyangtao * @date: 2019/6/12 * @time: 11:56 PM */public class Test {    /**     * 使用反射机制破解私有无参构造函数     * @param args     * @throws IllegalAccessException     * @throws InvocationTargetException     * @throws InstantiationException     * @throws NoSuchMethodException     */    public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException {        Lazy lazy = Lazy.getLazy();        Constructor<Lazy> lazyConstructor = Lazy.class.getDeclaredConstructor();        lazyConstructor.setAccessible(true);        Lazy lazy1 = lazyConstructor.newInstance();        System.out.println(lazy==lazy1);    }}